import java.awt.Color;
import java.awt.Graphics;

import javax.swing.JComponent;

@SuppressWarnings("serial")
public class ComponentColor extends JComponent{
	int dim;
	Color draw;
	ItemBoxed ib = new ItemBoxed();
	String hexcolor;

	
	
	public ComponentColor(Color c){
		this.draw = c;
		this.dim = 16;
		hexcolor = ib.hexToColor(c);
		
	}

	
	public void paintComponent(Graphics g){
	g.setColor(Color.LIGHT_GRAY);
	g.drawRect(0, 0, dim+5, dim+5);
	g.setColor(draw);
	g.fillRect(3, 3, dim, dim);
	g.setColor(Color.DARK_GRAY);
	g.drawString(hexcolor, dim+15, dim);
	}
}